package com.patterns.mediator.SaleComputer;

import java.util.Random;

/**
 * Created by Xiao Yiyun on 2017/4/29.
 * 销售管理
 */
public class Sale extends AbstractColleague {
    public Sale(AbstractMediator mediator) {
        super(mediator);
    }
    //销售电脑
    public void sellComputer(int number) {
        super.mediator.execute("sale.sell", number);
        System.out.println("销售电脑" + number + "台");
    }
    //反馈情况
    public int getSalseStatus() {
        Random random = new Random(System.currentTimeMillis());
        int saleStatus = random.nextInt(100);
        System.out.println("电脑的销售情况为" + saleStatus);
        return saleStatus;
    }
    //折价处理
    public void offSale() {
        super.mediator.execute("sale.offsell");
    }
 }
